package com.train.monitor;
/**
 * 消费者
 * */
public class Consumer implements Runnable{
    private SyncContainer syncContainer;
    public Consumer(SyncContainer syncContainer) {
        this.syncContainer = syncContainer;
    }

    @Override
    public void run() {
        // 消费者消费
        for (int i = 0; i < 24; i++) {
            try {
                syncContainer.pop();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
